// math_mod.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "math_mod.h"
#include <math.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

mathOper::mathOper()
{
	m_strOper = "%";
	m_strGapLeft = "";
	m_StrGapRight = "";
	SetOperAtribute();
}

mathOper::~mathOper()
{

}

void mathOper::SetOperAtribute()
{
	m_Attribute.unit = BINARY;
	m_Attribute.priority = LEVEL_SECOND;
	m_Attribute.type = OPERATOR;
}

void mathOper::Release()
{
	delete this;
}

void mathOper::Evaluate( double *dbDatas,int nCount )
{
	if (nCount == 2)
	{
		m_dbResult =((int)dbDatas[0]) % ((int) dbDatas[1]);
	}
	else
	{
		TRACE("the Count of Operands of \"%\" is wrong!");
#ifdef _DEBUG

#endif
	}
}

BOOL  __stdcall CreatePlugObj(void** pPlugObj)
{
	*pPlugObj= new mathOper; 
	return *pPlugObj != NULL;
}

void ReleasePlugObj(mathOper* pPlugObj)
{
	delete pPlugObj;
	pPlugObj = NULL;
}